#pragma once

// Definitions
#include "api.hpp"
#include "basedefs.hpp"
#include "buffer.hpp"
#include "shader.hpp"
#include "program.hpp"
#include "texture2d.hpp"
#include "vertex_array.hpp"

// Implementations
#include "impl/buffer.inl"
#include "impl/shader.inl"
#include "impl/program.inl"
#include "impl/texture2d.inl"
#include "impl/vertex_array.inl"

namespace opengl {

struct opengl_config {
    float clear_color[4] = {0.0, 0.0, 0.0, 1.0};
    voidptr (*load_function)(const char *) = nullptr;
    void (*debug_msg_callback)(u32, u32, u32, u32, i32, const char *, const void *) = nullptr;
};
opengl_config global_opengl_config{};

OPENGLAPI void init_opengl(const opengl_config &cfg);
OPENGLAPI void clear_buffers();

} // namespace opengl

#include "impl/opengl.inl"